package com.gxa.web_admin.controller;

import com.gxa.common.vo.JsonResult;
import com.gxa.common.vo.R;
import com.gxa.modules.pojo.CustComplian;
import com.gxa.modules.service.Cust_ComplianService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/cust_complian")
public class Cust_ComplianController {
    @Autowired
    private Cust_ComplianService cust_complianService;

    /**
     * 分页查询客户投诉列表
     * @param currentPage
     * @param pageSize
     * @return
     */
    @GetMapping("/findCust_complian")
    public JsonResult findCustcomplian(Integer currentPage, Integer pageSize){
        return cust_complianService.findCustComplian(currentPage,pageSize);
    }

    /**
     * 增加客户投诉
     * @param custComplian
     * @return
     */
    @PostMapping("/addCust_complian")
    public R addCustcomplian(CustComplian custComplian){
        return cust_complianService.addCust_Complian(custComplian);
    }

    /**
     *删除客户投诉
     * @param id
     * @return
     */
    @PostMapping("/deleteCust_complian")
    public R deleteCustcomplian(Integer id){
        return cust_complianService.deleteCust_Complian(id);
    }

    /**
     * 批量删除客户投诉
     * @param ids
     * @return
     */
    @PostMapping("/deleteCust_complianList")
    public R deleteCustcomplianList(int[] ids){
        return cust_complianService.deleteCust_ComplianList(ids);
    }

    /**
     * 修改客户投诉
     * @param custComplian
     * @return
     */
    @PostMapping("/updateCust_complian")
    public R updateCustcomplian(CustComplian custComplian){
        return cust_complianService.updateCust_Complian(custComplian);
    }

    /**
     * 查看客户显示
     * @param id
     * @return
     */
    @GetMapping("/seeCust_complian")
    public JsonResult seeCustcomplian(Integer id){
        return cust_complianService.seeCust_Complian(id);
    }

    /**
     * 添加处理
     * @param id
     * @param deal_note
     * @param deal_time
     * @return
     */
    @PostMapping("/dealCust_complian")
    public R dealCustcomplian(Integer id, String deal_note, String deal_time){
        return cust_complianService.dealCust_Complian(id,deal_note,deal_time);
    }

    /**
     * 添加完结
     * @param id
     * @param end_note
     * @param end_time
     * @return
     */
    @PostMapping("/endCust_complian")
    public R endCustcomplian(Integer id, String end_note, String end_time){
        return cust_complianService.endCust_Complian(id,end_note,end_time);
    }

    /**
     *条件搜索客户投诉
     * @param customerName
     * @param waybillNumber
     * @param complianType
     * @param operatorTime
     * @return
     */
    @PostMapping("/searchCust_complian")
    public JsonResult searchcomplian(String customerName, String waybillNumber, Integer complianType, String operatorTime){
        return cust_complianService.searchCust_Complian(customerName,waybillNumber,complianType,operatorTime);
    }
}
